﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="UserAccounts.aspx.cs" Inherits="AspNetTraining.UserAccounts" %>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="gvAccounts" runat="server" Width="855px" BorderStyle="Solid"
        ShowFooter="True"
                CellPadding="4" ForeColor="#333333" 
                GridLines="Both" AutoGenerateColumns="False" Height="195px">
      <Columns>
          <asp:TemplateField HeaderText="User Name">
              <ItemTemplate>
                  <a ID="hlEdit"   href="UserAccountDetail.aspx?id=<%# Eval("UserAccountID") %>"><%#Eval("UserName")%></a>       
                  <asp:Label ID="lblID" runat="server" Visible="false"
                                  Text='<%#Eval("UserName")%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
                    <asp:TemplateField HeaderText="First Name">
              <ItemTemplate>
                  <asp:Label ID="lblFirstName" runat="server"
                                  Text='<%#Eval("FirstName")%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
            <asp:TemplateField HeaderText="Last Name">
              <ItemTemplate>
                  <asp:Label ID="lblLastName" runat="server"
                                  Text='<%#Eval("LastName")%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="Birthday">
              <ItemTemplate>
                  <asp:Label ID="lblBirthday" runat="server"
                                  Text='<%#String.Format("{0:MM/dd/yy}",Eval("Birthday"))%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
           <asp:TemplateField HeaderText="Email">
              <ItemTemplate>
                  <asp:Label ID="lblEmail" runat="server"
                                  Text='<%#Eval("Email")%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
           <asp:TemplateField HeaderText="CreatedOn">
              <ItemTemplate>
                  <asp:Label ID="lblCreatedOn" runat="server"
                                  Text='<%#String.Format("{0:MM/dd/yy}", Eval("CreatedOn"))%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
           <asp:TemplateField HeaderText="CreatedBy">
              <ItemTemplate>
                  <asp:Label ID="lblCreatedBy" runat="server"
                                  Text='<%#GetUserNameByID(Eval("CreatedBy"))%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
           <asp:TemplateField HeaderText="ModifiedOn">
              <ItemTemplate>
                  <asp:Label ID="lblModifiedOn" runat="server"
                                  Text='<%#String.Format("{0:MM/dd/yy}", Eval("ModifiedOn"))%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
           <asp:TemplateField HeaderText="ModifiedBy">
              <ItemTemplate>
                  <asp:Label ID="lblModifiedBy" runat="server"
                                  Text='<%#GetUserNameByID(Eval("ModifiedBy"))%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="Group User">
              <ItemTemplate>
                  <asp:Label ID="lblGroupUserID" runat="server"
                                  Text='<%#GetGroupUserByID(Eval("GroupUserID"))%>'>
                                        </asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
           <asp:TemplateField HeaderText="Description">
              <ItemTemplate>
                  <asp:Label ID="lblDescription" runat="server"
                                  Text='<%#Eval("Description")%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
           <asp:TemplateField HeaderText="Active">
              <ItemTemplate>
                  <asp:Label ID="lblActive" runat="server"
                                  Text='<%#Eval("Active")%>'></asp:Label>
              </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField >
              <ItemTemplate>
                   <asp:CheckBox ID="chkDelete" runat="server"  />
                   <a ID="hlEdit"   href="UserAccountDetail.aspx?id=<%# Eval("UserAccountID") %>">Edit</a>                 
                   <a ID="hlDelete" onclick='<%# "return confirm(\"Are you want delete account ?\");" %>'   href="UserAccounts.aspx?id=<%# Eval("UserAccountID") %>">Delete</a>                                        
              </ItemTemplate>
          </asp:TemplateField>   
      </Columns>      
    </asp:GridView>
         <div>
             <a ID="hlCreateNew"  href="UserAccountDetail.aspx">Create New</a>
            <asp:LinkButton runat="server" Text="Delete Choose" OnClick="Unnamed_Click" OnClientClick='return confirm(\"Are you want delete account selected ?\");'></asp:LinkButton>
         </div>
</asp:Content>
